<template>
  <el-card>
    <!-- 发起人 -->
    <template v-if="data.activeSource == 0">
      <div class="mb5">发起人：</div>
      <Table :data="promoter" />
    </template>

    <!-- 男方 -->
    <div class="mb5">男方（参与人）：</div>
    <Table :data="menList" />

    <!-- 女方 -->
    <div class="mb5 mt5">女方（参与人）：</div>
    <Table :data="womenList" />
  </el-card>
</template>
<script setup lang="ts">
import * as ActivityInfoApi from '@/api/blind/activityInfo'
import Table from './Table.vue'

const { data } = defineProps<{ data }>()
const promoter = ref([]) // 发起人
const menList = ref([]) // 男方列表
const womenList = ref([]) // 女方列表

onMounted(async () => {
  const fetchDate = await ActivityInfoApi.getActivityEnrollList({
    activityId: data.id,
    activeSource: data.activeSource
  })
  promoter.value = fetchDate.promoter
  menList.value = fetchDate.menList
  womenList.value = fetchDate.womenList
})
</script>
<style scoped lang="scss">
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
</style>
